/**
 * Choicesoft.com.cn Inc.
 * Copyright (c) 2004-2018 All Rights Reserved.
 */
package com.test.springboot;

import javax.jms.Destination;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsMessagingTemplate;
import org.springframework.stereotype.Component;

/**
 * @author chenxubing
 * @version $Id: Sender.java, v 0.1 2018-11-08 9:16 AM chenxubing Exp $$
 */
@Component
public class Sender {
    @Autowired
    private JmsMessagingTemplate jmsMessagingTemplate;
    @Autowired
    private Destination destination;

    public void send(String msg) {
        System.out.println("send " + msg);
        this.jmsMessagingTemplate.convertAndSend(this.destination, msg);
    }
}
